package entity;

public class AccessToken {
    private String token;
    private long expiresTime;
    private String errcode;


    public String getErrcode() {
        return errcode;
    }

    public void setErrcode(String errcode) {
        this.errcode = errcode;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public long getExpiresTime() {
        return expiresTime;
    }

    public void setExpiresTime(long expiresTime) {
        this.expiresTime = expiresTime;
    }

    public AccessToken(String token, int expiresIn) {
        this.token = token;
        expiresTime = System.currentTimeMillis()+expiresIn*1000;
    }

    public boolean isExpires(){
        return System.currentTimeMillis()>expiresTime;
    }
}
